package com.tz.crm.service.impl;

import com.tz.crm.dao.PropertyDao;
import com.tz.crm.entity.Property;
import com.tz.crm.service.PropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * PropertyServiceImpl服务类
 * 模板查询服务
 */
@Service
@Transactional
public class PropertyServiceImpl extends BaseServiceImpl<Property, String> implements PropertyService {

    @Autowired
    private PropertyDao propertyDao;

    /**
     * 有参构造
     *
     * @param propertyDao 注入的组件
     */
    @Autowired
    public PropertyServiceImpl(PropertyDao propertyDao) {
        this.propertyDao = propertyDao;
        super.setBaseDao(propertyDao);
    }

    @Override
    public List<Property> getByContractTemplateId(String id) {
        return propertyDao.getByContractTemplateId(id);
    }

    @Override
    public int getPropertyAmount(String id) {
        return propertyDao.getPropertyAmount(id);
    }

    @Override
    public Property getPropertyBySeq(String templateId, int seq) {
        return propertyDao.getPropertyBySeq(templateId, seq);
    }

}
